package org.csmz.xg2333.Example17;

public class Num {
    public void print(int num1,int num2,String fh){
        class Jsj{
            public int add(){
                return num1+num2;
            }
            public int jian(){
                return num1-num2;
            }
        }
        Jsj jsj = new Jsj();
        if (fh == "+"){
            System.out.println("计算结果为："+ jsj.add());
        }else if (fh == "-"){
            System.out.println("计算结果为"+jsj.jian());
        }else{
            System.out.println("请输入加减法");
        }
    }
}
